#include <iostream>
using namespace std;
class Rectangle{
private:
    int w;
    int h;
public:
    Rectangle(int _w = 0, int _h = 0){
        w = _w;
        h = _h;
    }
    void nhapVao();
    void hienThi();
    // Cong hai hinh chu nhat
    Rectangle operator + (const Rectangle&r2);
    Rectangle operator - (const Rectangle&r2);
    friend ostream&  operator << (ostream &os, const Rectangle& r);
    friend istream&  operator >> (istream &is, Rectangle& r);
    friend float area(Rectangle rc);

};
// Yeu cau tinh dien tich cua 1 hcn cho truoc
 float area(Rectangle rc)
 {
     return rc.w * rc.h;
 }
 void Rectangle::nhapVao(){
     cin>>w;
     cin>>h;
 }
ostream&  operator << (ostream &os, const Rectangle& r)
{
    os<<endl<<r.w<<"   "<<r.h;
    return os;
}
istream&  operator >> (istream &is, Rectangle& r){
    cout<<"Nhap vao hai chieu:";
    is>>r.w;
    is>>r.h;
    return is;
}
void Rectangle::hienThi(){
    cout<<endl<<w<<"   "<<h;
}
Rectangle Rectangle::operator + (const Rectangle&r2)
{
    Rectangle tmp;
    tmp.w = w + r2.w;
    tmp.h = h + r2.h;
    return tmp;
}
Rectangle Rectangle::operator - (const Rectangle&r2)
{
    Rectangle tmp;
    tmp.w = w - r2.w;
    tmp.h = h - r2.h;
    return tmp;
}

int main()
{
    Rectangle r0;
    cin>>r0;
    cout<< r0;
}
